package com.xuelang.pipeline.domain.pipeline.repository;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.PipelineGroupQuery;
import com.xuelang.pipeline.domain.pipeline.PipelineGroup;

import java.util.List;

/**
 * 流水线分组仓库
 *
 * @author liuyuan.ly
 * @since 2024/5/14 9:48
 */
public interface PipelineGroupRepository {
    /**
     * 获取流水线分组列表，有过滤条件
     *
     * @param currentPage
     * @param pageSize
     * @param pipelineGroup
     * @return
     */
    PageRecord<PipelineGroup> pageList(long currentPage, long pageSize, PipelineGroup pipelineGroup);
    /**
     * 获取流水线分组列表，有过滤条件
     *
     * @param pipelineGroup
     * @return
     */
    List<PipelineGroup> list(PipelineGroup pipelineGroup);


    /**
     * 新增流水线分组
     *
     * @param pipelineGroup
     * @return
     */
    Boolean save(PipelineGroup pipelineGroup);

    /**
     * 更新流水线分组
     *
     * @param pipelineGroup
     * @return
     */
    Boolean update(PipelineGroup pipelineGroup);
    /**
     * 删除流水线分组
     *
     * @param uuid
     * @return
     */
    Boolean delete(String uuid);

    /**
     * 根据条件删除
     * @param condition
     * @return
     */
    Boolean deleteByCondition(PipelineGroup condition);

    /**
     * 查询流水线分组
     *
     * @param uuid
     * @return
     */
    PipelineGroup query(String uuid);

    /**
     * 根据分组uuid查询关联关系
     * @param groupUuid
     * @return
     */
    List<PipelineGroup> queryByGroupUuid(String groupUuid);

    /**
     * 通过流水线编码删除关联流水线分组
     *
     * @param pipelineCode
     * @return
     */
    Boolean deleteByPipelineCode(String pipelineCode);

    /**
     * 流水线分组变更
     * @param query
     * @param creatorId
     * @return
     */
    Boolean modifyPipelineGroups(PipelineGroupQuery query, String creatorId);
}
